package com.example.demo.sys.mapper;

import com.example.demo.sys.entity.User;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import org.apache.ibatis.annotations.Select;
import org.apache.ibatis.annotations.Update;

/**
 * <p>
 *  Mapper 接口 chrimer
 * </p>
 *
 * @author chrimer
 * @since 2020-06-23
 */
public interface UserMapper extends BaseMapper<User> {
    @Select("Select id from  user WHERE username=#{username} and role=#{role}")
    String SelectId(String username,String role);

    @Update("UPDATE user SET password=#{password} WHERE id=#{id}")
    void UpdatePassword(String id, String password);

    @Update("UPDATE user SET status=#{status} WHERE id=#{id}")
    void updateUseful(String id, Integer status);

}
